package com.nbwyctf.helper.feign;

import feign.FeignException;
import feign.Response;
import feign.codec.ErrorDecoder;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;

/**
 * @author chetaifu
 */
public class StashErrorDecoder implements ErrorDecoder {
    private static final Logger logger = LoggerFactory.getLogger(StashErrorDecoder.class);
    @Override
    public Exception decode(String methodKey, Response response) {
        logger.error("decode response error", FeignException.errorStatus(methodKey, response));
        throw new RuntimeException("decode exception");
    }
}
